package com.cloud.bean.order;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author liuyuan
 * @since 2022-07-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("o_order")
public class Order extends Model<Order> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 商户流水号(商户下单)
     */
    private String customerSeq;

    /**
     * 渠道流水号
     */
    private String channelSeq;

    /**
     * 商户编号
     */
    private String customerNo;

    private String title;

    /**
     * 商品id
     */
    private Long skuId;

    /**
     * user表外键
     */
    private Long userId;

    /**
     * 买方类型
     */
    private String buyerType;

    private Long parentId;

    /**
     * 订单类型
     */
    private String orderType;

    /**
     * 订单状态
     */
    private String orderStatus;

    private Long userAddressId;

    /**
     * 收货时间
     */
    private LocalDateTime receipTime;

    /**
     * 订单确认时间
     */
    private LocalDateTime finishedTime;

    /**
     * 支付成功时间
     */
    private LocalDateTime payTime;

    /**
     * 订单数量
     */
    private Integer tradeNumber;

    /**
     * 支付金额
     */
    private BigDecimal tradeAmount;

    /**
     * 商品总额
     */
    private BigDecimal priceAmount;

    /**
     * 优惠总额
     */
    private BigDecimal couponAmount;

    /**
     * 交易手续费
     */
    private BigDecimal feeAmount;

    /**
     * 运费
     */
    private BigDecimal freightAmount;

    /**
     * 打包费
     */
    private BigDecimal packageAmount;

    /**
     * 折扣
     */
    private BigDecimal discountAmount;

    /**
     * 备注
     */
    private String remark;

    /**
     * 会员编码
     */
    private String vipCode;

    /**
     * 第三方的用户id
     */
    private String openId;

    /**
     * 支付方式
     */
    private String payType;

    private LocalDateTime createDate;

    private LocalDateTime updateDate;

    /**
     * 渠道手续费
     */
    private BigDecimal channelFee;

    /**
     * 渠道商户号
     */
    private String channelNo;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
